package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the STOCK_TAKING_ID database table.
 * 
 */
@Entity
@Table(name="STOCK_TAKING_ID")
@NamedQuery(name="StockTakingId.findAll", query="SELECT s FROM StockTakingId s")
public class StockTakingId implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="STOCK_TAKING_ID")
	private long stockTakingId;

	@Temporal(TemporalType.DATE)
	@Column(name="STOCK_TAKING_DATE")
	private Date stockTakingDate;

	//bi-directional many-to-one association to StockTakingDetail
	@OneToMany(mappedBy="stockTakingIdBean")
	private List<StockTakingDetail> stockTakingDetails;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="STAFF_ID")
	private Staff staff;

	//bi-directional many-to-one association to Warehouse
	@ManyToOne
	@JoinColumn(name="WHOUSE_ID")
	private Warehouse warehouse;

	public StockTakingId() {
	}

	public long getStockTakingId() {
		return this.stockTakingId;
	}

	public void setStockTakingId(long stockTakingId) {
		this.stockTakingId = stockTakingId;
	}

	public Date getStockTakingDate() {
		return this.stockTakingDate;
	}

	public void setStockTakingDate(Date stockTakingDate) {
		this.stockTakingDate = stockTakingDate;
	}

	public List<StockTakingDetail> getStockTakingDetails() {
		return this.stockTakingDetails;
	}

	public void setStockTakingDetails(List<StockTakingDetail> stockTakingDetails) {
		this.stockTakingDetails = stockTakingDetails;
	}

	public StockTakingDetail addStockTakingDetail(StockTakingDetail stockTakingDetail) {
		getStockTakingDetails().add(stockTakingDetail);
		stockTakingDetail.setStockTakingIdBean(this);

		return stockTakingDetail;
	}

	public StockTakingDetail removeStockTakingDetail(StockTakingDetail stockTakingDetail) {
		getStockTakingDetails().remove(stockTakingDetail);
		stockTakingDetail.setStockTakingIdBean(null);

		return stockTakingDetail;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public Warehouse getWarehouse() {
		return this.warehouse;
	}

	public void setWarehouse(Warehouse warehouse) {
		this.warehouse = warehouse;
	}

}